import React, { Component } from 'react'
import styles from "./SearchInput.module.scss"

/* 1. 引入 withRouter */
import { withRouter} from "react-router-dom"
class SearchInput extends Component {
    handleClick = (params) => {
        // 跳转到搜索中心
        console.log(this.props);
        this.props.history.push("searchCenter");
    }
    
    render() {
        return (
            <div className={styles.siOutBox} onClick={this.handleClick}>
                <div className={styles.siInnerBox}>
                    <div className={styles.boxItem1}><span className="iconfont icon-fangdajing">高跟鞋</span></div>
                    <div className={styles.boxItem2}><span className="iconfont icon-camera"></span></div>
                </div>
            </div>
        )
    }
}
/* 2. 用 withRouter 高阶函数 接受组件 返回一个包装过的组件 */
export default withRouter(SearchInput)
